package com.ninth_group.exception.handler;

import com.ninth_group.result.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;


@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(Exception.class)
    public static R handleException(Exception e) {
        System.err.println("操作失败: " + '\n' + e);
        return R.error("服务器异常！~！~", e);
    }
}
